///*      */ package com.iris.egrant.web.struts2.tags;
///*      */
///*      */ import com.iris.egrant.component.model.CriteriaSet;
///*      */ import com.iris.egrant.component.service.SearchService;
///*      */ import com.iris.egrant.remote.http.service.ServiceFactory;
///*      */ import com.iris.egrant.system.appsetting.service.AppSettingContext;
///*      */ import com.iris.egrant.system.appsetting.service.AppSettingService;
///*      */ import com.iris.egrant.app.utils.IrisStringUtils;
///*      */ import com.iris.egrant.utils.JsonUtils;
///*      */ import com.iris.egrant.web.struts2.Struts2Utils;
///*      */ import freemarker.template.Configuration;
///*      */ import freemarker.template.Template;
///*      */ import java.io.Writer;
///*      */ import java.util.ArrayList;
///*      */ import java.util.Date;
///*      */ import java.util.HashMap;
///*      */ import java.util.List;
///*      */ import java.util.Map;
///*      */ import javax.servlet.http.HttpServletRequest;
///*      */ import javax.servlet.http.HttpServletResponse;
///*      */ import javax.servlet.jsp.JspException;
///*      */ import javax.servlet.jsp.tagext.BodyTagSupport;
///*      */ import org.apache.commons.httpclient.util.DateUtil;
///*      */ import org.apache.commons.lang.BooleanUtils;
///*      */ import org.apache.commons.lang.ObjectUtils;
///*      */ import org.apache.commons.lang.StringUtils;
///*      */ import org.springframework.context.i18n.LocaleContextHolder;
///*      */ import org.springframework.web.context.WebApplicationContext;
///*      */ import org.springframework.web.context.support.WebApplicationContextUtils;
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */ public class SearchTag
///*      */   extends BodyTagSupport
///*      */ {
///*      */   private static final long serialVersionUID = 1077194066541229822L;
///*   43 */   private String key = "";
///*   44 */   private String businessKey = "";
///*   45 */   private String displayCount = "3";
///*   46 */   private String style = "";
///*   47 */   private String leftStyle = "";
///*   48 */   private String repeatColumn = "1";
///*   49 */   private String startNum = "1";
///*   50 */   private Integer num = Integer.valueOf(1);
///*   51 */   private String sqlConditionStr = "";
///*   52 */   private String extend = "";
///*   53 */   private String isAutoSearch = "false";
///*   54 */   private String gridDefaultStatus = "true";
///*      */
///*      */   public int doStartTag() throws JspException {
///*   57 */     HttpServletResponse response = (HttpServletResponse)this.pageContext.getResponse();
///*   58 */     response.setHeader("Cache-Control", "no-store");
///*   59 */     response.setDateHeader("Expires", 0L);
///*   60 */     response.setHeader("Pragma", "no-cache");
///*   61 */     WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*      */
///*      */
///*   65 */     Configuration cptFreemarkereConfiguration = (Configuration)ctx.getBean("cptFreemarkereConfiguration");
///*      */
///*      */
///*      */     try {
///*   69 */       Map<String, Object> rootMap = new HashMap<String, Object>();
///*      */
///*   71 */       String res = (String)this.pageContext.getAttribute("res");
///*   72 */       rootMap.put("res", res);
///*   73 */       rootMap.put("id", this.key);
///*      */
///*   75 */       Template template = cptFreemarkereConfiguration.getTemplate("search.ftl", "utf-8");
///*   76 */       rootMap.put("content", render());
///*      */
///*   78 */       template.process(rootMap, (Writer)this.pageContext.getOut());
///*      */     }
///*   80 */     catch (Exception e) {
///*   81 */       throw new JspException(e);
///*      */     }
///*      */
///*   84 */     return 0;
///*      */   }
///*      */
///*      */   private String render() throws Exception {
///*   88 */     StringBuffer tbHtml = new StringBuffer();
///*   89 */     HttpServletRequest request = (HttpServletRequest)this.pageContext.getRequest();
///*   90 */     String tblHtmlLeft = "";
///*   91 */     String tblHtmlRight = "";
///*      */
///*   93 */     String cssStyle = "";
///*   94 */     if (this.style != null && !"".equals(this.style)) {
///*   95 */       cssStyle = "style='" + this.style + "'";
///*      */     }
///*   97 */     tbHtml.append("<input type=\"hidden\" value=\"" + this.businessKey + "\" id=\"businessKey\" name=\"businessKey\"/>");
///*      */
///*   99 */     tbHtml.append("<table id=\"_dyn_panel\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\"" + cssStyle + " functionKey='" + this.key + "'>\r\n");
///*      */
///*      */
///*  102 */     List<CriteriaSet> criteriaSet = new ArrayList<CriteriaSet>();
///*  103 */     List<CriteriaSet> criteriaSetSub = new ArrayList<CriteriaSet>();
///*  104 */     if (this.key != null && !"".equals(this.key)) {
///*  105 */       WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  107 */       ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*      */
///*  109 */       List<CriteriaSet> criteriaSetAll = ((SearchService)serviceFactory.getService(SearchService.class)).findSearchByKey(this.key + getBusinessKey());
///*  110 */       if (!StringUtils.isBlank(getBusinessKey()) && criteriaSetAll.size() == 0) {
///*  111 */         criteriaSetAll = ((SearchService)serviceFactory.getService(SearchService.class)).findSearchByKey(this.key);
///*      */       }
///*  113 */       for (int k = 0; k < criteriaSetAll.size(); k++) {
///*  114 */         if ("0".equals(((CriteriaSet)criteriaSetAll.get(k)).getIsGridShow())) {
///*  115 */           criteriaSet.add(criteriaSetAll.get(k));
///*      */         } else {
///*  117 */           criteriaSetSub.add(criteriaSetAll.get(k));
///*      */         }
///*      */       }
///*      */     } else {
///*  121 */       return "&nbsp;";
///*      */     }
///*      */
///*  124 */     if (criteriaSet.size() == 0) {
///*  125 */       return "请补充检索条件配置：functionKey=" + this.key;
///*      */     }
///*      */
///*  128 */     int count = 3;
///*  129 */     if (this.displayCount != null && !"".equals(this.displayCount)) {
///*  130 */       count = Integer.parseInt(this.displayCount);
///*      */     }
///*      */
///*  133 */     int repeatCol = 1;
///*  134 */     if (this.repeatColumn != null && !"".equals(this.repeatColumn)) {
///*  135 */       repeatCol = Integer.parseInt(this.repeatColumn);
///*      */     }
///*  137 */     if (this.leftStyle != null && !"".equals(this.leftStyle)) {
///*  138 */       cssStyle = "style=\"" + this.leftStyle + "\"";
///*      */     }
///*      */
///*  141 */     List<String> requestParamsName = new ArrayList<String>();
///*      */
///*  143 */     Map<String, Object> paramsMap = deCompostCondition();
///*  144 */     paramsMap.putAll(request.getParameterMap());
///*      */
///*  146 */     for (int index = 0; index < criteriaSet.size(); index++) {
///*  147 */       CriteriaSet item = criteriaSet.get(index);
///*      */
///*  149 */       String fieldName = item.getFieldName();
///*      */
///*  151 */       if (paramsMap.containsKey(fieldName) && StringUtils.isBlank(item.getPosition())) {
///*  152 */         requestParamsName.add(fieldName);
///*      */       }
///*      */     }
///*      */
///*      */
///*  157 */     if (this.startNum.matches("[1-9]\\d*")) {
///*  158 */       this.num = Integer.valueOf(Integer.parseInt(this.startNum));
///*      */     } else {
///*  160 */       this.num = Integer.valueOf(1);
///*      */     }
///*  162 */     String script = getTagScript(request, criteriaSet);
///*      */
///*  164 */     tblHtmlLeft = getPositionHtml(request, "L", criteriaSet);
///*  165 */     tblHtmlRight = getPositionHtml(request, "R", criteriaSet);
///*  166 */     int cnt = tblHtmlLeft.equals("") ? 0 : 1;
///*  167 */     cnt = tblHtmlRight.equals("") ? (cnt + 0) : (cnt + 1);
///*  168 */     if (count > criteriaSet.size()) {
///*  169 */       count = criteriaSet.size();
///*      */     }
///*  171 */     count -= cnt;
///*  172 */     if (count == 0 && (!"".equalsIgnoreCase(tblHtmlLeft) || !"".equalsIgnoreCase(tblHtmlRight))) {
///*  173 */       tbHtml.append("     <tr>\r\n");
///*  174 */       tbHtml.append(tblHtmlLeft);
///*  175 */       tbHtml.append(tblHtmlRight);
///*  176 */       tbHtml.append("     </tr>\r\n");
///*      */     }
///*  178 */     String extendFunction = "";
///*  179 */     if (!this.extend.equals("")) {
///*  180 */       extendFunction = "executeExtendFunc_" + this.key + "();";
///*      */     }
///*  182 */     String extendFuncAutoComplete = "";
///*  183 */     List<String> fieldNames = new ArrayList<String>();
///*  184 */     List<Long> seqNos = new ArrayList<Long>();
///*  185 */     for (int i = 0; i < criteriaSet.size(); i++) {
///*  186 */       CriteriaSet item = criteriaSet.get(i);
///*  187 */       String tagType = item.getTagType();
///*  188 */       if ("treeSelect_autoComplete".equalsIgnoreCase(tagType) || "treeSelectMulti_autoComplete".equalsIgnoreCase(tagType) || "treeSelect_NP_autoComplete".equalsIgnoreCase(tagType) || "treeSelectMulti_NP_autoComplete".equalsIgnoreCase(tagType)) {
///*      */
///*      */
///*      */
///*  192 */         extendFuncAutoComplete = "extendFuncAutoComplete_" + this.key.replace("-", "_") + "();";
///*  193 */         fieldNames.add(item.getFieldName());
///*  194 */         seqNos.add(Long.valueOf(item.getId().getSeqNo()));
///*      */       }
///*      */     }
///*  197 */     for (int j = 0; j < count; j++) {
///*  198 */       if (j > 0) {
///*  199 */         tbHtml.append("<tr><td colspan=\"9\" height=\"6px\">&nbsp;</td></tr>");
///*      */       }
///*  201 */       tbHtml.append("     <tr>\r\n");
///*  202 */       if (j == 0) {
///*  203 */         tbHtml.append(tblHtmlLeft);
///*      */       }
///*  205 */       for (int r = 0; r < repeatCol; r++) {
///*      */
///*  207 */         if (j + r >= criteriaSet.size() || j + r >= count) {
///*      */           break;
///*      */         }
///*      */
///*  211 */         String baseId = "_dyn_criteria" + String.valueOf(j + r + this.num.intValue());
///*      */
///*  213 */         tbHtml.append("         <td id=\"" + baseId + "\">\r\n").append("             <select class=\"layer002\" id=\"" + baseId + "_field\" name=\"" + baseId + "_field\" " + cssStyle + " onchange=\"_dyn_ShowCriteriaTag(this);" + extendFunction + extendFuncAutoComplete + "\">\r\n");
///*      */
///*      */
///*      */
///*      */
///*  218 */         CriteriaSet selectedItem = null;
///*      */
///*  220 */         int selectedItemIndex = getCriteriaSelectedIndex(request, j + r + this.num.intValue());
///*  221 */         String selectedItemIndexId = getCriteriaSelectedIndexId(j + r + this.num.intValue());
///*      */
///*      */         int k;
///*  224 */         for (k = 0; k < criteriaSet.size(); k++) {
///*  225 */           CriteriaSet item = criteriaSet.get(k);
///*  226 */           String fieldName = item.getFieldName();
///*  227 */           if (requestParamsName.contains(fieldName) && k < count) {
///*  228 */             requestParamsName.remove(fieldName);
///*      */           }
///*      */         }
///*      */
///*  232 */         for (k = 0; k < criteriaSet.size(); k++) {
///*  233 */           CriteriaSet item = criteriaSet.get(k);
///*      */
///*  235 */           String fieldCaption = item.getFieldCaption();
///*  236 */           String fieldName = item.getFieldName();
///*  237 */           String selected = "";
///*  238 */           if (selectedItemIndex == k && selectedItem == null) {
///*      */
///*  240 */             selected = "selected='selected'";
///*  241 */             selectedItem = item;
///*  242 */           } else if (requestParamsName.contains(fieldName) && selectedItem == null) {
///*  243 */             selected = "selected='selected'";
///*  244 */             selectedItem = item;
///*  245 */             selectedItemIndex = k;
///*  246 */             requestParamsName.remove(fieldName);
///*  247 */           } else if (k == j + r && selectedItemIndex == -1 && selectedItem == null && requestParamsName.size() == 0) {
///*      */
///*  249 */             selected = "selected='selected'";
///*  250 */             selectedItem = item;
///*  251 */             selectedItemIndex = k;
///*      */           }
///*  253 */           tbHtml.append("             <option title=\"" + fieldCaption + "\" value=\"" + fieldName + "\" " + selected + ">" + fieldCaption + "</option>\r\n");
///*      */         }
///*      */
///*      */
///*  257 */         tbHtml.append("             </select>\r\n").append("             <input type=\"hidden\" id=\"" + selectedItemIndexId + "\" name=\"" + selectedItemIndexId + "\" value=\"" + String.valueOf(selectedItemIndex) + "\">\r\n").append("         </td>\r\n").append("         <td id=\"" + baseId + "_c\">\r\n").append(getSelectedItemHtml(selectedItem, request)).append("</td>\r\n");
///*      */
///*      */
///*      */
///*      */
///*  262 */         tbHtml.append("            <td width=\"20px\"></td>\r\n");
///*      */       }
///*      */
///*  265 */       j += repeatCol - 1;
///*  266 */       if (j >= count) {
///*  267 */         tbHtml.append(tblHtmlRight);
///*      */       }
///*  269 */       tbHtml.append("     </tr>\r\n");
///*      */     }
///*  271 */     tbHtml.append("</table>");
///*  272 */     if (criteriaSetSub.size() > 0) {
///*  273 */       tbHtml = getGridHtml(request, criteriaSetSub, criteriaSet, tbHtml);
///*      */     }
///*  275 */     if (!this.extend.equals("")) {
///*  276 */       Map extendMap = JsonUtils.getMap4Json(this.extend);
///*  277 */       String extendStr = getExtendScript(request, extendMap);
///*  278 */       tbHtml.append(extendStr);
///*      */     }
///*      */
///*  281 */     if (fieldNames.size() > 0) {
///*  282 */       String extendStr = getExtendScript2(request, fieldNames, seqNos);
///*  283 */       tbHtml.append(extendStr);
///*      */     }
///*      */
///*      */
///*  287 */     tbHtml.append(script);
///*  288 */     return tbHtml.toString();
///*      */   }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */   private StringBuffer getGridHtml(HttpServletRequest request, List<CriteriaSet> criteriaSetSub, List<CriteriaSet> criteriaSet, StringBuffer tbHtml) {
///*  299 */     tbHtml.append("<div class=\"s_condition\" id=\"_dyn_panel\" style=\"display:" + ((BooleanUtils.toBoolean(this.gridDefaultStatus) == true) ? "" : "none") + "\" functionKey='" + this.key + "'>\r\n<div style=\"text-align:right;height:20px;\"><a onclick=\"cleanUp();\"   class=\"clearup\"  />清除选择</a></div>");
///*  300 */     Map<String, Object> paramsMap = deCompostCondition();
///*  301 */     paramsMap.putAll(request.getParameterMap());
///*  302 */     for (int i = 0; i < criteriaSetSub.size(); i++) {
///*  303 */       tbHtml.append("<dl id=\"" + ((CriteriaSet)criteriaSetSub.get(i)).getFieldName() + "\" >\r\n");
///*  304 */       List<Map<String, Object>> data = getTagData(request, criteriaSetSub.get(i));
///*  305 */       String baseId = "_dyn_criteria" + String.valueOf(criteriaSet.size() + i + this.num.intValue());
///*  306 */       tbHtml.append("<dt id=\"" + baseId + "\"  >\r\n").append(((CriteriaSet)criteriaSetSub.get(i)).getFieldCaption() + "：").append(" <input type=\"hidden\" value=\"" + ((CriteriaSet)criteriaSetSub.get(i)).getFieldName() + "\" id=\"_dyn_criteria" + criteriaSet.size() + i + "_field\" />").append("</dt>\r\n<dd>");
///*      */
///*      */
///*  309 */       String value = "";
///*  310 */       String tagName = ((CriteriaSet)criteriaSetSub.get(i)).getFieldName();
///*      */
///*  312 */       if (!isPostBack(request)) {
///*  313 */         if (paramsMap.get(tagName) == null) {
///*  314 */           value = "";
///*      */         } else {
///*  316 */           value = (paramsMap.get(tagName).getClass() == String[].class) ? ((String[])paramsMap.get(tagName))[0] : paramsMap.get(tagName).toString();
///*      */         }
///*      */       }
///*  319 */       if (StringUtils.isBlank(value)) {
///*  320 */         String defaultValue = ((CriteriaSet)criteriaSetSub.get(i)).getDefaultValue();
///*  321 */         if (StringUtils.isNotBlank(defaultValue)) {
///*  322 */           WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  324 */           ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*  325 */           value = ((AppSettingService)serviceFactory.getService(AppSettingService.class)).getValue(defaultValue);
///*      */
///*  327 */           if (value == null) {
///*  328 */             value = defaultValue;
///*      */           }
///*      */         }
///*      */       }
///*      */
///*  333 */       if (IrisStringUtils.isNullOrBlank(value)) {
///*  334 */         for (int j = 0; j < data.size(); j++) {
///*  335 */           if (j == 0) {
///*  336 */             tbHtml.append(" <input type=\"hidden\"  value=\"" + ((Map)data.get(j)).get("CODE") + "\"/> <a href=\"###\" selecttype=\"" + ((CriteriaSet)criteriaSetSub.get(i)).getTagType() + "\"  onclick=\"setGridCss(this);" + ((BooleanUtils.toBoolean(this.isAutoSearch) == true) ? "autoSearch();" : "") + "\" class=\"c_item_checked\">" + ((Map)data.get(j)).get("NAME") + "<span class=\"close\"></span></a>");
///*      */           } else {
///*  338 */             tbHtml.append(" <input type=\"hidden\"  value=\"" + ((Map)data.get(j)).get("CODE") + "\"/> <a href=\"###\" selecttype=\"" + ((CriteriaSet)criteriaSetSub.get(i)).getTagType() + "\" onclick=\"setGridCss(this);" + ((BooleanUtils.toBoolean(this.isAutoSearch) == true) ? "autoSearch();" : "") + "\">" + ((Map)data.get(j)).get("NAME") + "<span class=\"close\"></span></a>");
///*      */           }
///*      */         }
///*      */       } else {
///*  342 */         for (int j = 0; j < data.size(); j++) {
///*  343 */           value = "," + value + ",";
///*  344 */           if (value.indexOf("," + ObjectUtils.toString(((Map)data.get(j)).get("CODE")) + ",") != -1) {
///*  345 */             tbHtml.append(" <input type=\"hidden\"  value=\"" + ((Map)data.get(j)).get("CODE") + "\"/> <a href=\"###\" selecttype=\"" + ((CriteriaSet)criteriaSetSub.get(i)).getTagType() + "\" onclick=\"setGridCss(this);" + ((BooleanUtils.toBoolean(this.isAutoSearch) == true) ? "autoSearch();" : "") + "\" class=\"c_item_checked\">" + ((Map)data.get(j)).get("NAME") + "<span class=\"close\"></span></a>");
///*      */           } else {
///*  347 */             tbHtml.append(" <input type=\"hidden\"  value=\"" + ((Map)data.get(j)).get("CODE") + "\"/> <a href=\"###\" selecttype=\"" + ((CriteriaSet)criteriaSetSub.get(i)).getTagType() + "\" onclick=\"setGridCss(this);" + ((BooleanUtils.toBoolean(this.isAutoSearch) == true) ? "autoSearch();" : "") + "\">" + ((Map)data.get(j)).get("NAME") + "<span class=\"close\"></span></a>");
///*      */           }
///*      */         }
///*      */       }
///*  351 */       tbHtml.append("</dd>\r\n <div class=\"clear\"></div>\r\n</dl>");
///*      */     }
///*  353 */     tbHtml.append("</div>");
///*  354 */     return tbHtml;
///*      */   }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */   private List<Map<String, Object>> getTagData(HttpServletRequest request, CriteriaSet criteriaSet) {
///*  365 */     List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();
///*  366 */     CriteriaSet item = criteriaSet;
///*  367 */     String dsSQL = ObjectUtils.toString(item.getDsScript());
///*      */
///*      */
///*  370 */     if (!"".equals(dsSQL)) {
///*      */
///*  372 */       List<String> perchList = IrisStringUtils.extractFromSpecStr(dsSQL, null, 0);
///*  373 */       Map<String, Object> conditionMap = new HashMap<String, Object>();
///*  374 */       if (!"".equals(this.sqlConditionStr)) {
///*  375 */         conditionMap.putAll(JsonUtils.getMap4Json(this.sqlConditionStr));
///*      */       }
///*  377 */       for (String queryStr : perchList) {
///*  378 */         Object queryValue = conditionMap.get(queryStr);
///*  379 */         if (queryValue != null) {
///*  380 */           dsSQL = IrisStringUtils.regexReplaceString(dsSQL, "\\[@" + queryStr + "@\\]", (queryValue == null) ? "null" : queryValue.toString());
///*      */         }
///*      */       }
///*      */
///*      */
///*  385 */       WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  387 */       ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*  388 */       data = ((SearchService)serviceFactory.getService(SearchService.class)).getDsScriptData(dsSQL);
///*      */     }
///*  390 */     return data;
///*      */   }
///*      */   private String getExtendScript(HttpServletRequest request, Map map) {
///*  393 */     StringBuffer script = new StringBuffer();
///*  394 */     script.append("\r\n<script type=\"text/javascript\">\r\n");
///*  395 */     String extendType = (String)map.get("type");
///*  396 */     String locale = getLocale();
///*  397 */     if ("autoComplete".equals(extendType)) {
///*  398 */       String fieldName = (String)map.get("field");
///*  399 */       String key = (String)map.get("key");
///*  400 */       String[] fns = fieldName.split(",");
///*  401 */       String[] keys = key.split(",");
///*      */
///*  403 */       script.append("$(document).ready(function(){\r\n");
///*      */       int i;
///*  405 */       for (i = 0; i < keys.length; i++) {
///*  406 */         script.append("irisAutocomplete(\"" + fns[i] + "\",ctx+\"/cpt/ajaxload-complete\",{\"locale\":\"" + locale + "\",\"key\":\"" + keys[i] + "\",\"cacheable\":\"false\",\"sqlParamVal\":\"\"},{\"onClick\":\"\",\"isAdd\":\"false\",\"searchKey\":\"" + this.key + "\"});");
///*      */       }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  415 */       script.append("});\r\n");
///*      */
///*  417 */       script.append("function executeExtendFunc_" + this.key + "() { \r\n");
///*  418 */       for (i = 0; i < keys.length; i++) {
///*  419 */         script.append("irisAutocomplete(\"" + fns[i] + "\",ctx+\"/cpt/ajaxload-complete\",{\"locale\":\"" + locale + "\",\"key\":\"" + keys[i] + "\",\"cacheable\":\"false\",\"sqlParamVal\":\"\"},{\"onClick\":\"\",\"isAdd\":\"false\",\"searchKey\":\"" + this.key + "\"});");
///*      */       }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  428 */       script.append("}\r\n");
///*      */     }
///*      */
///*  431 */     script.append("\r\n</script>\r\n");
///*  432 */     return script.toString();
///*      */   }
///*      */
///*      */   private String getExtendScript2(HttpServletRequest request, List<String> flist, List<Long> seqNos) {
///*  436 */     StringBuffer script = new StringBuffer();
///*  437 */     script.append("\r\n<script type=\"text/javascript\">\r\n");
///*      */
///*  439 */     script.append("$(document).ready(function(){\r\n");
///*      */     int i;
///*  441 */     for (i = 0; i < flist.size(); i++) {
///*  442 */       script.append("irisAutocomplete(\"" + (String)flist.get(i) + "_text" + "\",ctx+\"/cpt/ajaxload-complete\",{\"locale\":\"" + LocaleContextHolder.getLocale() + "\",\"key\":\"" + this.key + "\",\"seq_no\":\"" + seqNos.get(i) + "\",\"category\":\"CriteriaSet" + "\",\"fName\":\"" + (String)flist.get(i) + "\",\"cacheable\":\"false\",\"sqlParamVal\":\"\"},{\"category\":\"CriteriaSet" + "\",\"fName\":\"" + (String)flist.get(i) + "\",\"seq_no\":\"" + seqNos.get(i) + "\",\"onClick\":\"\",\"isAdd\":\"false\",\"searchKey\":\"" + this.key + "\"});");
///*      */     }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  450 */     script.append("});\r\n");
///*      */
///*  452 */     script.append("function extendFuncAutoComplete_" + this.key.replace("-", "_") + "() { \r\n");
///*  453 */     for (i = 0; i < flist.size(); i++) {
///*  454 */       script.append("irisAutocomplete(\"" + (String)flist.get(i) + "_text" + "\",ctx+\"/cpt/ajaxload-complete\",{\"locale\":\"" + LocaleContextHolder.getLocale() + "\",\"key\":\"" + this.key + "\",\"seq_no\":\"" + seqNos.get(i) + "\",\"category\":\"CriteriaSet" + "\",\"fName\":\"" + (String)flist.get(i) + "\",\"cacheable\":\"false\",\"sqlParamVal\":\"\"},{\"category\":\"CriteriaSet" + "\",\"fName\":\"" + (String)flist.get(i) + "\",\"seq_no\":\"" + seqNos.get(i) + "\",\"onClick\":\"\",\"isAdd\":\"false\",\"searchKey\":\"" + this.key + "\"});");
///*      */     }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  462 */     script.append("}\r\n");
///*      */
///*  464 */     script.append("\r\n</script>\r\n");
///*  465 */     return script.toString();
///*      */   }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */   private String getTagScript(HttpServletRequest request, List<CriteriaSet> criteriaSet) {
///*  479 */     StringBuffer script = new StringBuffer();
///*  480 */     String locale = getLocale();
///*  481 */     String resRoot = "/egrantres";
///*  482 */     script.append("\r\n<script type=\"text/javascript\" src=\"" + resRoot + "/js/plugins/datepicker/jquery.datepick-" + locale + ".js\"></script>\r\n");
///*      */
///*  484 */     script.append("\r\n<script type=\"text/javascript\">\r\n");
///*  485 */     script.append("//<![CDATA[\r\n");
///*      */
///*  487 */     List<String> tagDs = new ArrayList<String>();
///*  488 */     Map<String, Integer> fieldIndexMap = new HashMap<String, Integer>();
///*  489 */     for (int index = 0; index < criteriaSet.size(); index++) {
///*  490 */       CriteriaSet item = criteriaSet.get(index);
///*  491 */       String fieldName = item.getFieldName();
///*  492 */       fieldIndexMap.put(fieldName, Integer.valueOf(index));
///*      */     }
///*      */
///*  495 */     StringBuffer tbFixedItem = new StringBuffer();
///*  496 */     for (int i = 0; i < criteriaSet.size(); i++) {
///*  497 */       CriteriaSet item = criteriaSet.get(i);
///*      */
///*  499 */       String fieldName = item.getFieldName();
///*  500 */       String dsSQL = ObjectUtils.toString(item.getDsScript());
///*      */
///*      */
///*  503 */       String cascadeField = "";
///*      */
///*  505 */       String tagJSON = getTagJSON(item);
///*      */
///*  507 */       script.append("window['_dyn_" + fieldName + "']=[" + tagJSON + "];\r\n");
///*  508 */       script.append("window['_dyn_" + fieldName + "_dssql']=[{'fKey':'" + item.getId().getFunctionKey() + "','seqNo':'" + item.getId().getSeqNo() + "'}];\r\n");
///*      */
///*  510 */       if (!StringUtils.isBlank(item.getCascadeField())) {
///*  511 */         script.append("window['_dyn_" + item.getCascadeField() + "_cascade']=[{'id':'" + fieldName + "'}];\r\n");
///*      */       }
///*  513 */       if (!"".equals(dsSQL)) {
///*      */
///*  515 */         List<String> perchList = IrisStringUtils.extractFromSpecStr(dsSQL, null, 0);
///*  516 */         Map<String, Object> conditionMap = new HashMap<String, Object>();
///*  517 */         if (!"".equals(this.sqlConditionStr)) {
///*  518 */           conditionMap.putAll(JsonUtils.getMap4Json(this.sqlConditionStr));
///*      */         }
///*      */
///*  521 */         for (String queryStr : perchList) {
///*  522 */           Object queryValue = conditionMap.get(queryStr);
///*  523 */           if (queryValue != null) {
///*  524 */             dsSQL = IrisStringUtils.regexReplaceString(dsSQL, "\\[@" + queryStr + "@\\]", (queryValue == null) ? "null" : queryValue.toString());
///*      */           }
///*      */         }
///*      */
///*      */
///*  529 */         if (tagDs.contains(fieldName)) {
///*      */           continue;
///*      */         }
///*  532 */         tagDs.add(fieldName);
///*      */
///*      */
///*  535 */         WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  537 */         ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*  538 */         List<String[]> ds = ((SearchService)serviceFactory.getService(SearchService.class)).getDsScriptList(dsSQL);
///*      */
///*  540 */         String key = "'_dyn_" + fieldName + "_ds'";
///*  541 */         if (!"treeSelect".equals(item.getTagType())) {
///*  542 */           getTagDsScript(script, ds, key);
///*      */         }
///*  544 */         if (!"".equals(cascadeField)) {
///*  545 */           int cascadeIndex = Integer.parseInt(ObjectUtils.toString(fieldIndexMap.get(cascadeField)));
///*  546 */           Map cascadeItem = (Map)criteriaSet.get(cascadeIndex);
///*  547 */           dsSQL = cascadeItem.get("DS_SCRIPT").toString();
///*  548 */           for (int k = 0; k < ds.size(); k++) {
///*  549 */             String[] dsi = ds.get(k);
///*  550 */             List temp = ((SearchService)serviceFactory.getService(SearchService.class)).getDsScriptList(dsSQL);
///*      */
///*  552 */             key = "'_dyn_" + cascadeField + "_" + dsi[0] + "_ds'";
///*      */
///*  554 */             getTagDsScript(script, temp, key);
///*      */           }
///*      */         }
///*      */       }
///*      */
///*      */
///*  560 */       if ("F".equalsIgnoreCase(item.getPosition()))
///*  561 */         tbFixedItem.append(",'" + item.getFieldName() + "'");
///*      */       continue;
///*      */     }
///*  564 */     script.append("//]]>\r\n");
///*  565 */     if (!"".equals(tbFixedItem.toString())) {
///*  566 */       script.append("var _dyn_fixedSelects=[" + tbFixedItem.substring(1) + "];\r\n");
///*      */     } else {
///*  568 */       script.append("var _dyn_fixedSelects=new Array();\r\n");
///*      */     }
///*  570 */     script.append("_dyn_initpanel('" + this.key + "');</script>\r\n");
///*      */
///*  572 */     return script.toString();
///*      */   }
///*      */
///*      */   private String getTagJSON(CriteriaSet item) {
///*  576 */     StringBuffer json = new StringBuffer();
///*  577 */     String fieldName = item.getFieldName();
///*  578 */     String tagType = item.getTagType();
///*      */
///*  580 */     String tagName = null;
///*  581 */     String cascadeField = "";
///*      */
///*  583 */     String cascadeFieldDisplay = "";
///*      */
///*  585 */     if (item.getTagName() != null && !"".equals(item.getTagName())) {
///*  586 */       tagName = item.getTagName();
///*      */     } else {
///*  588 */       tagName = fieldName;
///*      */     }
///*  590 */     String tagStyle = getTagStyle(item);
///*      */
///*      */
///*      */
///*      */
///*  595 */     json.append("{").append("'fieldName':'" + fieldName + "',").append("'tagType':'" + tagType + "',").append("'tagName':'" + tagName + "',").append("'tagStyle':" + tagStyle + ",").append("'cascadeField':'" + ((item.getCascadeField() == null) ? "" : item.getCascadeField()) + "',").append("'cascadeFieldDisplay':'" + ((item.getCascadeFieldDisplay() == null) ? "" : item.getCascadeFieldDisplay()) + "'").append("}");
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  605 */     return json.toString();
///*      */   }
///*      */
///*      */   private String getTagStyle(CriteriaSet item) {
///*  609 */     String style = "";
///*  610 */     if (item.getTagStyle() != null && !"".equals(item.getTagStyle())) {
///*  611 */       style = item.getTagStyle();
///*  612 */       if (style.endsWith(";")) {
///*  613 */         style = style.substring(0, style.length() - 1);
///*      */       }
///*  615 */       style = style.replaceAll(";", "'],['");
///*  616 */       style = style.replaceAll(":", "','");
///*  617 */       style = "[['" + style + "']]";
///*      */     } else {
///*  619 */       style = "''";
///*      */     }
///*  621 */     return style;
///*      */   }
///*      */
///*      */
///*      */   private void getTagDsScript(StringBuffer script, List<String[]> ds, String key) {
///*  626 */     script.append("window[" + key + "]=[");
///*      */
///*  628 */     for (int index = 0; index < ds.size(); index++) {
///*  629 */       String[] dsi = ds.get(index);
///*  630 */       for (int i = 0; i < dsi.length; i++) {
///*  631 */         dsi[i] = dsi[i].replace("\\", "\\\\").replace("[", "\\[").replace("]", "\\]");
///*      */       }
///*  633 */       if (dsi[0] == null || "".equals(dsi[0])) {
///*  634 */         dsi[0] = "";
///*      */       }
///*  636 */       if (dsi[1] == null || "".equals(dsi[1])) {
///*  637 */         dsi[1] = "";
///*      */       }
///*  639 */       if (dsi.length >= 3 && (
///*  640 */         dsi[2] == null || "".equals(dsi[2]))) {
///*  641 */         dsi[2] = "";
///*      */       }
///*      */
///*  644 */       dsi[1] = filterInvalidChar(dsi[1]);
///*      */
///*  646 */       if (index == 0) {
///*  647 */         if (dsi.length >= 3) {
///*  648 */           script.append("['" + dsi[0] + "','" + dsi[1] + "','" + dsi[2] + "']");
///*      */         } else {
///*  650 */           script.append("['" + dsi[0] + "','" + dsi[1] + "']");
///*      */         }
///*      */
///*  653 */       } else if (dsi.length >= 3) {
///*  654 */         script.append(",['" + dsi[0] + "','" + dsi[1] + "','" + dsi[2] + "']");
///*      */       } else {
///*  656 */         script.append(",['" + dsi[0] + "','" + dsi[1] + "']");
///*      */       }
///*      */     }
///*      */
///*  660 */     script.append("];\r\n");
///*      */   }
///*      */
///*      */   private String filterInvalidChar(String text) {
///*  664 */     return text.replaceAll("'", "\\\\'");
///*      */   }
///*      */
///*      */
///*      */   private String getPositionHtml(HttpServletRequest request, String type, List<CriteriaSet> criteriaSet) {
///*  669 */     StringBuilder html = new StringBuilder();
///*  670 */     if ("".equalsIgnoreCase(type) || "F".equalsIgnoreCase(type)) {
///*  671 */       return "";
///*      */     }
///*      */
///*  674 */     int count = 1;
///*  675 */     if ("R".equalsIgnoreCase(type)) {
///*  676 */       count = this.num.intValue() + Integer.parseInt(this.displayCount);
///*      */     }
///*  678 */     for (int index = 0; index < criteriaSet.size(); index++) {
///*  679 */       CriteriaSet item = criteriaSet.get(index);
///*  680 */       if (type.equalsIgnoreCase(ObjectUtils.toString(item.getPosition()))) {
///*  681 */         String fieldCaption = item.getFieldCaption();
///*  682 */         String fieldName = item.getFieldName();
///*  683 */         String baseId = "";
///*      */
///*  685 */         if ("L".equalsIgnoreCase(type)) {
///*  686 */           SearchTag searchTag = this; Integer integer1 = searchTag.num, integer2 = searchTag.num = Integer.valueOf(searchTag.num.intValue() + 1); baseId = "_dyn_criteria" + integer1;
///*  687 */         } else if ("R".equalsIgnoreCase(type)) {
///*  688 */           baseId = "_dyn_criteria" + count++;
///*      */         }
///*      */
///*  691 */         html.append("           <td id=\"" + baseId + "\">\r\n");
///*  692 */         html.append("           <select class=\"layer002\" id=\"" + baseId + "_field\" name=\"" + baseId + "_field\" disabled=\"true\" style=\"width:100px;\">\r\n");
///*      */
///*  694 */         html.append("<option title=\"" + fieldCaption + "\" value=\"" + fieldName + "\" selected='true'>" + fieldCaption + "</option>\r\n");
///*      */
///*  696 */         html.append("</select>\r\n");
///*  697 */         html.append("           </td>\r\n");
///*  698 */         html.append("           <td id=\"" + baseId + "_c\">\r\n");
///*  699 */         html.append(getSelectedItemHtml(item, request));
///*  700 */         html.append("           </td>\r\n");
///*  701 */         html.append("            <td width=\"20px\"></td>\r\n");
///*      */
///*  703 */         criteriaSet.remove(index);
///*  704 */         index--;
///*      */       }
///*      */     }
///*      */
///*  708 */     return html.toString();
///*      */   }
///*      */
///*      */
///*      */   private String getSelectedItemHtml(CriteriaSet item, HttpServletRequest request) {
///*  713 */     if (item == null) {
///*  714 */       return "";
///*      */     }
///*      */
///*  717 */     StringBuffer html = new StringBuffer();
///*      */
///*  719 */     String fieldName = item.getFieldName();
///*  720 */     String tagType = item.getTagType();
///*  721 */     String dsScript = item.getDsScript();
///*      */
///*  723 */     List<String> perchList = IrisStringUtils.extractFromSpecStr(dsScript, null, 0);
///*  724 */     Map<String, Object> conditionMap = new HashMap<String, Object>();
///*  725 */     if (!"".equals(this.sqlConditionStr)) {
///*  726 */       conditionMap.putAll(JsonUtils.getMap4Json(this.sqlConditionStr));
///*      */     }
///*      */
///*  729 */     for (String queryStr : perchList) {
///*  730 */       Object queryValue = conditionMap.get(queryStr);
///*  731 */       if (queryValue != null) {
///*  732 */         dsScript = IrisStringUtils.regexReplaceString(dsScript, "\\[@" + queryStr + "@\\]", (queryValue == null) ? "''" : queryValue.toString());
///*      */       }
///*      */     }
///*      */
///*      */
///*  737 */     String myStyle = "";
///*  738 */     if (item.getTagStyle() != null && !"".equals(item.getTagStyle())) {
///*  739 */       myStyle = "style=\"" + item.getTagStyle() + "\"";
///*      */     }
///*      */
///*  742 */     String tagName = fieldName;
///*      */
///*  744 */     if (item.getTagName() != null && !"".equals(item.getTagName())) {
///*  745 */       tagName = item.getTagName();
///*      */     }
///*  747 */     Map<String, Object> paramsMap = deCompostCondition();
///*  748 */     paramsMap.putAll(request.getParameterMap());
///*  749 */     String value = "";
///*      */
///*  751 */     if (!isPostBack(request)) {
///*  752 */       String defaultValue = item.getDefaultValue();
///*  753 */       if (paramsMap.get(item.getFieldName()) != null)
///*  754 */         defaultValue = (paramsMap.get(tagName).getClass() == String[].class) ? ((String[])paramsMap.get(tagName))[0] : paramsMap.get(tagName).toString();
///*  755 */       if (StringUtils.isNotBlank(defaultValue)) {
///*  756 */         WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  758 */         ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*  759 */         value = ((AppSettingService)serviceFactory.getService(AppSettingService.class)).getValue(defaultValue);
///*      */
///*  761 */         if (value == null) {
///*  762 */           value = defaultValue;
///*      */
///*      */         }
///*      */       }
///*  766 */       else if (paramsMap.get(tagName) == null) {
///*  767 */         value = "";
///*      */       } else {
///*  769 */         value = (paramsMap.get(tagName).getClass() == String[].class) ? ((String[])paramsMap.get(tagName))[0] : paramsMap.get(tagName).toString();
///*      */       }
///*      */
///*      */     }
///*  773 */     else if (paramsMap.get(tagName) == null) {
///*  774 */       value = "";
///*      */     } else {
///*  776 */       value = (paramsMap.get(tagName).getClass() == String[].class) ? ((String[])paramsMap.get(tagName))[0] : paramsMap.get(tagName).toString();
///*      */     }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  784 */     if ("text".equalsIgnoreCase(tagType)) {
///*  785 */       if (value == null) {
///*  786 */         value = "";
///*      */       }
///*      */
///*  789 */       html.append("           <input type=\"text\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" maxlength=\"300\" class=\"layer001\" " + myStyle + ">\r\n");
///*      */     }
///*  791 */     else if ("span".equalsIgnoreCase(tagType)) {
///*  792 */       if (value == null || "null".equals(value)) {
///*  793 */         value = "";
///*      */       }
///*  795 */       String vname = request.getParameter(tagName + "_name");
///*  796 */       html.append("           <span id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" vname=\"" + vname + "\" " + myStyle + "></span>\r\n");
///*      */     }
///*  798 */     else if ("select".equalsIgnoreCase(tagType)) {
///*  799 */       html.append("           <select class=\"layer002\" id=\"" + tagName + "\" name=\"" + tagName + "\" " + myStyle + ">\r\n");
///*      */
///*  801 */       if (!"".equals(dsScript)) {
///*  802 */         WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  804 */         ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*  805 */         List<String[]> ds = ((SearchService)serviceFactory.getService(SearchService.class)).getDsScriptList(dsScript);
///*      */
///*      */
///*  808 */         for (int j = 0; j < ds.size(); j++) {
///*  809 */           String[] dsi = ds.get(j);
///*  810 */           if (dsi[0] == null || "".equals(dsi[0])) {
///*  811 */             dsi[0] = "";
///*      */           }
///*  813 */           if (dsi[1] == null || "".equals(dsi[1])) {
///*  814 */             dsi[1] = "";
///*      */           }
///*  816 */           dsi[1] = dsi[1].replace(">", "&gt;").replace("<", "&lt;");
///*  817 */           if (value == null) {
///*  818 */             value = dsi[0];
///*      */           }
///*      */
///*      */
///*      */
///*      */
///*  824 */           if (value.equalsIgnoreCase(dsi[0])) {
///*  825 */             html.append("               <option title=\"" + dsi[1] + "\" value=\"" + dsi[0] + "\" selected=\"selected\">" + dsi[1] + "</option>\r\n");
///*      */           }
///*      */           else {
///*      */
///*  829 */             html.append("               <option title=\"" + dsi[1] + "\"  value=\"" + dsi[0] + "\" >" + dsi[1] + "</option>\r\n");
///*      */           }
///*      */         }
///*      */       }
///*      */
///*  834 */       html.append("           </select>\r\n");
///*  835 */     } else if ("treeSelect".equalsIgnoreCase(tagType) || "treeSelectMulti".equalsIgnoreCase(tagType) || "treeSelect_NP".equalsIgnoreCase(tagType) || "treeSelectMulti_NP".equalsIgnoreCase(tagType) || "treeSelect_autoComplete".equalsIgnoreCase(tagType) || "treeSelect_NP_autoComplete".equalsIgnoreCase(tagType) || "treeSelectMulti_autoComplete".equalsIgnoreCase(tagType) || "treeSelectMulti_NP_autoComplete".equalsIgnoreCase(tagType) || "treeSelect_Fuzzy".equalsIgnoreCase(tagType) || "treeSelectMulti_Fuzzy".equalsIgnoreCase(tagType) || "treeSelectMulti_NP_Fuzzy".equalsIgnoreCase(tagType) || "treeSelect_Fuzzy_autoComplete".equalsIgnoreCase(tagType) || "treeSelect_NP_Fuzzy_autoComplete".equalsIgnoreCase(tagType) || "treeSelectMulti_Fuzzy_autoComplete".equalsIgnoreCase(tagType) || "treeSelectMulti_NP_Fuzzy_autoComplete".equalsIgnoreCase(tagType)) {
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  847 */       if (!"".equals(StringUtils.trimToEmpty(value))) {
///*  848 */         if (!"".equals(dsScript)) {
///*  849 */           WebApplicationContext ctx = WebApplicationContextUtils.getWebApplicationContext(this.pageContext.getServletContext());
///*      */
///*  851 */           ServiceFactory serviceFactory = (ServiceFactory)ctx.getBean("serviceFactory");
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  860 */           String text = "";
///*  861 */           List<String> ds = ((SearchService)serviceFactory.getService(SearchService.class)).getDsScriptString(dsScript);
///*  862 */           for (int j = 0; j < ds.size(); j++) {
///*  863 */             String[] dsi = ((String)ds.get(j)).split("#");
///*  864 */             if (value.equalsIgnoreCase(dsi[0])) {
///*  865 */               text = text + "," + dsi[1];
///*      */               break;
///*      */             }
///*      */           }
///*  869 */           if (!StringUtils.isBlank(text)) {
///*  870 */             text = text.substring(1);
///*      */           }
///*  872 */           if (tagType.contains("autoComplete")) {
///*  873 */             html.append("<input type=\"text\" style=\"float:left\" id=\"" + tagName + "_text\" name=\"" + tagName + "_text\" value=\"" + text + "\" class=\"input_text_select\" " + myStyle + " onkeyup=\"syn_val('" + tagName + "','" + this.key + "');\" />");
///*      */
///*      */
///*  876 */             html.append("<a id=\"" + tagName + "_a\" class=\"inputSelectButtonAuto\" title=\"选择\" href=\"javascript:showSelect('" + tagName + "_text', '" + tagType + "', '" + this.key + "');\">选择</a>");
///*      */
///*      */
///*  879 */             html.append("<input type=\"hidden\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" " + myStyle + " />\r\n");
///*      */
///*      */
///*  882 */             html.append("\r\n<script type=\"text/javascript\">\r\n");
///*      */
///*  884 */             html.append("$(document).ready(function(){\r\n");
///*      */
///*  886 */             html.append("irisAutocomplete(\"" + tagName + "_text" + "\",ctx+\"/cpt/ajaxload-complete\",{\"locale\":\"" + LocaleContextHolder.getLocale() + "\",\"key\":\"" + item.getId().getFunctionKey() + "\",\"seq_no\":\"" + item.getId().getSeqNo() + "\",\"category\":\"CriteriaSet" + "\",\"fName\":\"" + tagName + "\",\"cacheable\":\"false\",\"sqlParamVal\":\"\"},{\"category\":\"CriteriaSet" + "\",\"fName\":\"" + tagName + "\",\"seq_no\":\"" + item.getId().getSeqNo() + "\",\"onClick\":\"\",\"isAdd\":\"false\",\"searchKey\":\"" + this.key + "\"});");
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  894 */             html.append("});\r\n");
///*  895 */             html.append("\r\n</script>\r\n");
///*      */           } else {
///*      */
///*  898 */             html.append("<input type=\"text\" style=\"float:left;width:115px\" id=\"" + tagName + "_text\" name=\"" + tagName + "_text\" readonly=\"readonly\" value=\"" + text + "\" class=\"input_text_select\" " + myStyle + " onclick=\"showSelect(this.id, '" + tagType + "', '" + this.key + "');\" />");
///*      */
///*      */
///*      */
///*  902 */             html.append("<a id=\"" + tagName + "_a\" class=\"inputSelectButton\" title=\"点击置空\" href=\"javascript:setEmptyValueForSelectTree('" + tagName + "','" + this.key + "');\">置空</a>");
///*      */
///*      */
///*      */
///*  906 */             html.append("<input type=\"hidden\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" " + myStyle + " />\r\n");
///*      */           }
///*      */
///*      */         }
///*      */       } else {
///*      */
///*  912 */         value = "";
///*  913 */         if (tagType.contains("autoComplete")) {
///*  914 */           html.append("<input type=\"text\" style=\"float:left; " + item.getTagStyle() + "\" id=\"" + tagName + "_text\" name=\"" + tagName + "_text\" value=\"" + value + "\" class=\"input_text_select\" " + myStyle + " onkeyup=\"syn_val('" + tagName + "','" + this.key + "');\" />");
///*      */
///*      */
///*      */
///*  918 */           html.append("<a id=\"" + tagName + "_a\" class=\"inputSelectButtonAuto\" title=\"选择\" href=\"javascript:showSelect('" + tagName + "_text', '" + tagType + "', '" + this.key + "');\">选择</a>");
///*      */
///*      */
///*  921 */           html.append("<input type=\"hidden\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" " + myStyle + "/>\r\n");
///*      */
///*      */
///*  924 */           html.append("\r\n<script type=\"text/javascript\">\r\n");
///*      */
///*  926 */           html.append("$(document).ready(function(){\r\n");
///*      */
///*  928 */           html.append("irisAutocomplete(\"" + tagName + "_text" + "\",ctx+\"/cpt/ajaxload-complete\",{\"locale\":\"" + LocaleContextHolder.getLocale() + "\",\"key\":\"" + item.getId().getFunctionKey() + "\",\"seq_no\":\"" + item.getId().getSeqNo() + "\",\"category\":\"CriteriaSet" + "\",\"fName\":\"" + tagName + "\",\"cacheable\":\"false\",\"sqlParamVal\":\"\"},{\"category\":\"CriteriaSet" + "\",\"fName\":\"" + tagName + "\",\"seq_no\":\"" + item.getId().getSeqNo() + "\",\"onClick\":\"\",\"isAdd\":\"false\",\"searchKey\":\"" + this.key + "\"});");
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*  935 */           html.append("});\r\n");
///*  936 */           html.append("\r\n</script>\r\n");
///*      */         } else {
///*      */
///*  939 */           html.append("<input type=\"text\" style=\"float:left\" id=\"" + tagName + "_text\" name=\"" + tagName + "_text\" readonly=\"readonly\" value=\"" + value + "\" class=\"input_text_select\" " + myStyle + " onclick=\"showSelect(this.id, '" + tagType + "', '" + this.key + "');\" />");
///*      */
///*      */
///*      */
///*  943 */           html.append("<a id=\"" + tagName + "_a\" class=\"inputSelectButton\" title=\"点击置空\" href=\"javascript:setEmptyValueForSelectTree('" + tagName + "','" + this.key + "');\">置空</a>");
///*      */
///*      */
///*      */
///*  947 */           html.append("<img id=\"" + tagName + "_tree_and_complete_img\" src=\"/egrantres/images/application_form_add.png\" style=\"cursor: pointer; vertical-align: bottom; margin-left: 3px;\"" + " onclick=\"showSelect('" + tagName + "_text','" + tagType + "','" + item.getId().getFunctionKey() + "')\">");
///*      */
///*      */
///*      */
///*  951 */           html.append("<input type=\"hidden\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" " + myStyle + "/>\r\n");
///*      */         }
///*      */       }
///*      */
///*  955 */       if (tagType.contains("_Fuzzy_")) {
///*  956 */         html.append("<input type=\"checkbox\" id=\"" + tagName + "_Fuzzy\" name=\"" + tagName + "_Fuzzy\" title=\"模糊查询\" style=\"vertical-align: middle; margin-top: 3px;\" /><label for=\"" + tagName + "_Fuzzy\" style=\"vertical-align: middle;\">模糊</label>\r\n");
///*      */
///*      */       }
///*      */
///*      */     }
///*  961 */     else if ("date".equalsIgnoreCase(tagType)) {
///*  962 */       if (value == null) {
///*  963 */         value = "";
///*      */       }
///*      */
///*  966 */       if ("sysdate".equalsIgnoreCase(value)) {
///*  967 */         Date now = new Date();
///*  968 */         value = DateUtil.formatDate(now, "yyyy-MM-dd");
///*  969 */       } else if (value.indexOf("-") >= 0) {
///*  970 */         String[] values = value.split("-");
///*  971 */         String year = values[0];
///*  972 */         if ("current_year".equalsIgnoreCase(year)) {
///*  973 */           year = AppSettingContext.getValue("stat_year");
///*      */         }
///*  975 */         value = year + "-" + values[1] + "-" + values[2];
///*      */       }
///*  977 */       if ("".equals(myStyle)) {
///*  978 */         myStyle = "style=\"float:left\"";
///*      */       } else {
///*  980 */         myStyle = myStyle.substring(0, myStyle.indexOf("\"") + 1) + "float:left;" + myStyle.substring(myStyle.indexOf("\"") + 1, myStyle.length());
///*      */       }
///*      */
///*  983 */       html.append("<input type=\"text\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" class=\"layer001\" " + myStyle + " />");
///*      */
///*      */
///*  986 */       html.append("<a id=\"" + tagName + "_a\" class=\"inputDateButton\" title=\"选择日期\" href=\"javascript:registerDateCtrl('" + tagName + "','" + this.key + "');\">选择日期</a>");
///*      */
///*      */
///*  989 */       html.append("\r\n");
///*  990 */     } else if ("time".equalsIgnoreCase(tagType)) {
///*  991 */       value = "";
///*      */
///*  993 */       if ("".equals(myStyle)) {
///*  994 */         myStyle = "style=\"float:left\"";
///*      */       } else {
///*  996 */         myStyle = myStyle.substring(0, myStyle.indexOf("\"") + 1) + "float:left;" + myStyle.substring(myStyle.indexOf("\"") + 1, myStyle.length());
///*      */       }
///*      */
///*  999 */       html.append("<input type=\"text\" id=\"" + tagName + "\" name=\"" + tagName + "\" value=\"" + value + "\" class=\"layer001\" " + myStyle + " />");
///*      */
///*      */
///* 1002 */       html.append("<a id=\"" + tagName + "_a\" class=\"inputDateButton\" title=\"选择时间\" href=\"javascript:registerTimeCtrl('" + tagName + "','" + this.key + "');\">选择时间</a>");
///*      */
///*      */
///* 1005 */       html.append("\r\n");
///*      */     }
///* 1007 */     return html.toString();
///*      */   }
///*      */
///*      */   private String getCriteriaSelectedIndexId(int index) {
///* 1011 */     String key = "_dyn_criteria" + String.valueOf(index) + "_selectedIndex";
///* 1012 */     return key;
///*      */   }
///*      */
///*      */   private int getCriteriaSelectedIndex(HttpServletRequest request, int index) {
///* 1016 */     String key = getCriteriaSelectedIndexId(index);
///* 1017 */     int temp = -1;
///* 1018 */     if (request.getParameter(key) != null && !"".equals(request.getParameter(key))) {
///* 1019 */       temp = Integer.parseInt(request.getParameter(key));
///*      */     }
///* 1021 */     return temp;
///*      */   }
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */
///*      */   private final Map<String, Object> deCompostCondition() {
///* 1030 */     Map<String, Object> conditions = new HashMap<String, Object>();
///* 1031 */     String originalstr = Struts2Utils.getParameter("searchString");
///* 1032 */     if (StringUtils.isBlank(originalstr)) {
///* 1033 */       return conditions;
///*      */     }
///* 1035 */     String[] originals = StringUtils.splitByWholeSeparator(originalstr, "[tear]");
///* 1036 */     for (String originalKV : originals) {
///* 1037 */       String[] originalkv = originalKV.split(":");
///* 1038 */       String dealWithK = originalkv[0];
///* 1039 */       String dealWithV = "";
///* 1040 */       if (originalkv.length == 2) {
///* 1041 */         dealWithV = originalkv[1];
///*      */       }
///* 1043 */       conditions.put(dealWithK, dealWithV);
///*      */     }
///* 1045 */     return conditions;
///*      */   }
///*      */
///*      */   private boolean isPostBack(HttpServletRequest request) {
///* 1049 */     String key = "businessKey";
///* 1050 */     Map params = request.getParameterMap();
///* 1051 */     return params.containsKey(key);
///*      */   }
///*      */
///*      */   public String getKey() {
///* 1055 */     return this.key;
///*      */   }
///*      */
///*      */   public void setKey(String key) {
///* 1059 */     this.key = key;
///*      */   }
///*      */
///*      */   public String getBusinessKey() {
///* 1063 */     return this.businessKey;
///*      */   }
///*      */
///*      */   public void setBusinessKey(String businessKey) {
///* 1067 */     this.businessKey = businessKey;
///*      */   }
///*      */
///*      */   public String getDisplayCount() {
///* 1071 */     return this.displayCount;
///*      */   }
///*      */
///*      */   public void setDisplayCount(String displayCount) {
///* 1075 */     this.displayCount = displayCount;
///*      */   }
///*      */
///*      */   public String getStyle() {
///* 1079 */     return this.style;
///*      */   }
///*      */
///*      */   public void setStyle(String style) {
///* 1083 */     this.style = style;
///*      */   }
///*      */
///*      */   public String getLeftStyle() {
///* 1087 */     return this.leftStyle;
///*      */   }
///*      */
///*      */   public void setLeftStyle(String leftStyle) {
///* 1091 */     this.leftStyle = leftStyle;
///*      */   }
///*      */
///*      */   public String getRepeatColumn() {
///* 1095 */     return this.repeatColumn;
///*      */   }
///*      */
///*      */   public void setRepeatColumn(String repeatColumn) {
///* 1099 */     this.repeatColumn = repeatColumn;
///*      */   }
///*      */
///*      */   public String getStartNum() {
///* 1103 */     return this.startNum;
///*      */   }
///*      */
///*      */   public void setStartNum(String startNum) {
///* 1107 */     this.startNum = startNum;
///*      */   }
///*      */
///*      */   public String getSqlConditionStr() {
///* 1111 */     return this.sqlConditionStr;
///*      */   }
///*      */
///*      */   public void setSqlConditionStr(String sqlConditionStr) {
///* 1115 */     this.sqlConditionStr = sqlConditionStr;
///*      */   }
///*      */
///*      */   private String getLocale() {
///* 1119 */     String locale = "zh_CN";
///* 1120 */     if (StringUtils.isBlank(locale)) {
///* 1121 */       return LocaleContextHolder.getLocale().toString();
///*      */     }
///* 1123 */     return locale;
///*      */   }
///*      */
///*      */   public String getExtend() {
///* 1127 */     return this.extend;
///*      */   }
///*      */
///*      */   public void setExtend(String extend) {
///* 1131 */     this.extend = extend;
///*      */   }
///*      */
///*      */   public String getIsAutoSearch() {
///* 1135 */     return this.isAutoSearch;
///*      */   }
///*      */
///*      */   public void setIsAutoSearch(String isAutoSearch) {
///* 1139 */     this.isAutoSearch = isAutoSearch;
///*      */   }
///*      */
///*      */   public String getGridDefaultStatus() {
///* 1143 */     return this.gridDefaultStatus;
///*      */   }
///*      */
///*      */   public void setGridDefaultStatus(String gridDefaultStatus) {
///* 1147 */     this.gridDefaultStatus = gridDefaultStatus;
///*      */   }
///*      */ }
//
//
///* Location:              D:\文件kjt\WEB-INF\lib\egrant-core-2.2.20240205.1659.jar!\com\iris\egrant\web\struts2\tags\SearchTag.class
// * Java compiler version: 6 (50.0)
// * JD-Core Version:       1.1.3
// */